update version to v2.1.7

This commit is contained in:
Artery-MCU
2025-08-05 10:24:08 +08:00
parent ee4796e775
commit 6dd65bdd62
122 changed files with 3730 additions and 14394 deletions

View File

@@ -128,7 +128,7 @@ extern "C" {
*/
#define __AT32F415_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */
#define __AT32F415_LIBRARY_VERSION_MIDDLE (0x01) /*!< [23:16] middle version */
#define __AT32F415_LIBRARY_VERSION_MINOR (0x06) /*!< [15:8] minor version */
#define __AT32F415_LIBRARY_VERSION_MINOR (0x07) /*!< [15:8] minor version */
#define __AT32F415_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __AT32F415_LIBRARY_VERSION ((__AT32F415_LIBRARY_VERSION_MAJOR << 24) | \
(__AT32F415_LIBRARY_VERSION_MIDDLE << 16) | \

View File

@@ -141,14 +141,14 @@ void system_core_clock_update(void)
pll_mult_h = CRM->cfg_bit.pllmult_h;
/* process high bits */
if((pll_mult_h != 0U) || (pll_mult == 15U)){
pll_mult += ((16U * pll_mult_h) + 1U);
pll_mult += ((16U * pll_mult_h) + 1U);
}
else
{
pll_mult += 2U;
pll_mult += 2U;
}
if (pll_clock_source == 0x00)
if(pll_clock_source == 0x00)
{
/* hick divided by 2 selected as pll clock entry */
system_core_clock = (HICK_VALUE >> 1) * pll_mult;
@@ -156,7 +156,7 @@ void system_core_clock_update(void)
else
{
/* hext selected as pll clock entry */
if (CRM->cfg_bit.pllhextdiv != RESET)
if(CRM->cfg_bit.pllhextdiv != RESET)
{
/* hext clock divided by 2 */
system_core_clock = (HEXT_VALUE / 2) * pll_mult;
@@ -173,7 +173,7 @@ void system_core_clock_update(void)
pll_ns = CRM->pll_bit.pllns;
pll_fr = CRM->pll_bit.pllfr;
if (pll_clock_source == 0x00)
if(pll_clock_source == 0x00)
{
/* hick divided by 2 selected as pll clock entry */
pllrcsfreq = (HICK_VALUE >> 1);
@@ -181,7 +181,7 @@ void system_core_clock_update(void)
else
{
/* hext selected as pll clock entry */
if (CRM->cfg_bit.pllhextdiv != RESET)
if(CRM->cfg_bit.pllhextdiv != RESET)
{
/* hext clock divided by 2 */
pllrcsfreq = (HEXT_VALUE / 2);

View File

@@ -0,0 +1,255 @@
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri",sans-serif;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{mso-style-link:"页眉 字符";
margin:0cm;
margin-bottom:.0001pt;
text-align:center;
layout-grid-mode:char;
border:none;
padding:0cm;
font-size:9.0pt;
font-family:"Calibri",sans-serif;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{mso-style-link:"页脚 字符";
margin:0cm;
margin-bottom:.0001pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Calibri",sans-serif;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-link:"批注框文本 字符";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:9.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
text-indent:21.0pt;
font-size:10.5pt;
font-family:"Calibri",sans-serif;}
span.a
{mso-style-name:"批注框文本 字符";
mso-style-link:;}
span.a0
{mso-style-name:"页眉 字符";
mso-style-link:;}
span.a1
{mso-style-name:"页脚 字符";
mso-style-link:;}
p.Default, li.Default, div.Default
{mso-style-name:Default;
margin:0cm;
margin-bottom:.0001pt;
text-autospace:none;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
color:black;}
.MsoChpDefault
{font-family:"Calibri",sans-serif;}
/* Page Definitions */
@page WordSection1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
layout-grid:15.6pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=ZH-CN style='text-justify-trim:punctuation'>
<div class=WordSection1 style='layout-grid:15.6pt'>
<p class=MsoNormal align=center style='text-align:center;word-break:break-all'><b><i><span
lang=EN-US style='font-size:16.0pt;font-family:"Arial",sans-serif;color:#0070C0'>Release
Notes for </span></i></b></p>
<p class=MsoNormal align=center style='text-align:center;word-break:break-all'><b><i><span
lang=EN-US style='font-size:16.0pt;font-family:"Arial",sans-serif;color:#0070C0'>AT32F415
Firmware Library Drivers</span></i></b></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.6-2025/08/04</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span lang=EN-US>GPIO</span></p>
<p class=MsoListParagraph style='margin-left:42.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US style='font-family:Wingdings'>l<span
style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
style='font-family:宋体'>新增</span><span lang=EN-US>gpio_bits_toggle()</span><span
style='font-family:宋体'>函数。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span lang=EN-US>TMR</span></p>
<p class=MsoListParagraph style='margin-left:42.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US style='font-family:Wingdings'>l<span
style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
style='font-family:宋体'>更新</span><span lang=EN-US>tmr_pwm_input_config()</span><span
style='font-family:宋体'></span><span lang=EN-US>tmr_encoder_mode_config()</span><span
style='font-family:宋体'></span><span lang=EN-US>tmr_output_channel_config()</span><span
style='font-family:宋体'>函数。通道模式配置前关闭通道使能,否则通道模式无法切换。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span lang=EN-US>USART</span></p>
<p class=MsoListParagraph style='margin-left:42.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US style='font-family:Wingdings'>l<span
style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
style='font-family:宋体'>更新</span><span lang=EN-US>usart_flag_clear()</span><span
style='font-family:宋体'>函数,更改</span><span lang=EN-US>USART_RDBF_FLAG</span><span
style='font-family:宋体'>的清除方式为读</span><span lang=EN-US>DT</span><span
style='font-family:宋体'>寄存器清。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新部分注释。</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>&nbsp;</span></b></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.5-2024/12/13</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新</span><span lang=EN-US>CAN</span><span
style='font-family:宋体'>驱动。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新</span><span lang=EN-US>USB</span><span
style='font-family:宋体'>驱动。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新部分注释。</span></p>
<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.4-2024/08/08</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新</span><span lang=EN-US>i2c_flag_clear</span><span
style='font-family:宋体'></span><span lang=EN-US>i2c_init</span><span
style='font-family:宋体'>函数。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新部分注释。</span></p>
<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.3-2024/01/05</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>完善部分驱动流程在</span><span lang=EN-US>IAR7.4</span><span
style='font-family:宋体'>下的编译警告。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新</span><span lang=EN-US>iar/gcc</span><span
style='font-family:宋体'>启动文件中</span><span lang=EN-US>ERTC</span><span
style='font-family:宋体'>对应的中断函数名。</span></p>
<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.2-2023/10/26</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'></span><span lang=EN-US>IP</span><span
style='font-family:宋体'>驱动新增</span><span lang=EN-US>interrupt_flag_get</span><span
style='font-family:宋体'>函数。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>优化系统时钟切换流程。</span></p>
<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.1-2023/08/04</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span lang=EN-US>CRC</span><span style='font-family:宋体'>驱动新增多项式及多项式宽度可修改的支持。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新了</span><span lang=EN-US>adc_ordinary_channel_set</span><span
style='font-family:宋体'></span><span lang=EN-US>adc_preempt_channel_set</span><span
style='font-family:宋体'>函数流程。</span></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新部分注释。</span></p>
<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
<p class=MsoNormal style='word-break:break-all'><b><span lang=EN-US
style='font-family:"Arial",sans-serif;color:#7030A0'>V2.0.0-2022/11/18</span></b></p>
<p class=MsoListParagraph style='margin-left:21.0pt;text-indent:-21.0pt;
word-break:break-all'><span lang=EN-US>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-family:宋体'>更新当</span><span lang=EN-US>HICK</span><span
style='font-family:宋体'>作为</span><span lang=EN-US>PLL</span><span
style='font-family:宋体'>时钟源时</span><span lang=EN-US>CRM_HICK48_NODIV</span><span
style='font-family:宋体'>作为默认设置。</span></p>
</div>
</body>
</html>

View File

@@ -707,7 +707,7 @@ typedef struct
__IO uint32_t inten;
struct
{
__IO uint32_t tcien : 1; /* [0] */
__IO uint32_t tcien : 1; /* [0] */
__IO uint32_t rf0mien : 1; /* [1] */
__IO uint32_t rf0fien : 1; /* [2] */
__IO uint32_t rf0oien : 1; /* [3] */

View File

@@ -786,6 +786,7 @@ flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins);
uint16_t gpio_output_data_read(gpio_type *gpio_x);
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_toggle(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state);
void gpio_port_write(gpio_type *gpio_x, uint16_t port_value);
void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins);

View File

@@ -763,14 +763,14 @@ void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
/* process high bits */
if((pll_mult_h != 0U) || (pll_mult == 15U))
{
pll_mult += ((16U * pll_mult_h) + 1U);
pll_mult += ((16U * pll_mult_h) + 1U);
}
else
{
pll_mult += 2U;
pll_mult += 2U;
}
if (pll_clock_source == 0x00)
if(pll_clock_source == 0x00)
{
/* hick divided by 2 selected as pll clock entry */
clocks_struct->sclk_freq = (HICK_VALUE >> 1) * pll_mult;
@@ -778,7 +778,7 @@ void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
else
{
/* hext selected as pll clock entry */
if (CRM->cfg_bit.pllhextdiv != RESET)
if(CRM->cfg_bit.pllhextdiv != RESET)
{
/* hext clock divided by 2 */
clocks_struct->sclk_freq = (HEXT_VALUE / 2) * pll_mult;
@@ -795,7 +795,7 @@ void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
pll_ns = CRM->pll_bit.pllns;
pll_fr = CRM->pll_bit.pllfr;
if (pll_clock_source == 0x00)
if(pll_clock_source == 0x00)
{
/* hick divided by 2 selected as pll clock entry */
pllrcsfreq = (HICK_VALUE >> 1);
@@ -803,7 +803,7 @@ void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
else
{
/* hext selected as pll clock entry */
if (CRM->cfg_bit.pllhextdiv != RESET)
if(CRM->cfg_bit.pllhextdiv != RESET)
{
/* hext clock divided by 2 */
pllrcsfreq = (HEXT_VALUE / 2);

View File

@@ -341,6 +341,37 @@ void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
gpio_x->clr = pins;
}
/**
* @brief toggle the selected data port bits.
* @param gpio_x: to select the gpio peripheral.
* this parameter can be one of the following values:
* GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
* @param pins: gpio pin number
* parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
* - GPIO_PINS_0
* - GPIO_PINS_1
* - GPIO_PINS_2
* - GPIO_PINS_3
* - GPIO_PINS_4
* - GPIO_PINS_5
* - GPIO_PINS_6
* - GPIO_PINS_7
* - GPIO_PINS_8
* - GPIO_PINS_9
* - GPIO_PINS_10
* - GPIO_PINS_11
* - GPIO_PINS_12
* - GPIO_PINS_13
* - GPIO_PINS_14
* - GPIO_PINS_15
* - GPIO_PINS_ALL
* @retval none
*/
void gpio_bits_toggle(gpio_type *gpio_x, uint16_t pins)
{
gpio_x->odt ^= pins;
}
/**
* @brief set or clear the selected data port bit.
* @param gpio_x: to select the gpio peripheral.

View File

@@ -319,21 +319,31 @@ void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_chan
/* set channel output mode */
channel = tmr_channel;
/* reset output channel(complementary) enable bit */
chx_offset = (tmr_channel * 2);
chcx_offset = ((tmr_channel * 2) + 2);
tmr_x->cctrl &= ~(1<<chcx_offset);
tmr_x->cctrl &= ~(1<<chx_offset);
switch(channel)
{
case TMR_SELECT_CHANNEL_1:
tmr_x->cm1_output_bit.c1c = FALSE;
tmr_x->cm1_output_bit.c1octrl = tmr_output_struct->oc_mode;
break;
case TMR_SELECT_CHANNEL_2:
tmr_x->cm1_output_bit.c2c = FALSE;
tmr_x->cm1_output_bit.c2octrl = tmr_output_struct->oc_mode;
break;
case TMR_SELECT_CHANNEL_3:
tmr_x->cm2_output_bit.c3c = FALSE;
tmr_x->cm2_output_bit.c3octrl = tmr_output_struct->oc_mode;
break;
case TMR_SELECT_CHANNEL_4:
tmr_x->cm2_output_bit.c4c = FALSE;
tmr_x->cm2_output_bit.c4octrl = tmr_output_struct->oc_mode;
break;
@@ -358,9 +368,6 @@ void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_chan
tmr_x->cctrl &= ~(1<<chx_offset);
tmr_x->cctrl |= channel_index;
chx_offset = (tmr_channel * 2);
chcx_offset = ((tmr_channel * 2) + 2);
/* get channel enable bit position in cctrl register */
channel_index = (uint16_t)(tmr_output_struct->oc_output_state << (tmr_channel * 2));
@@ -368,11 +375,9 @@ void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_chan
channel_c_index = (uint16_t)(tmr_output_struct->occ_output_state << ((tmr_channel * 2) + 2));
/* set output channel complementary enable bit */
tmr_x->cctrl &= ~(1<<chcx_offset);
tmr_x->cctrl |= channel_c_index;
/* set output channel enable bit */
tmr_x->cctrl &= ~(1<<chx_offset);
tmr_x->cctrl |= channel_index;
}
@@ -798,7 +803,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
switch(channel)
{
case TMR_SELECT_CHANNEL_1:
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c1p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c1cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm1_input_bit.c1c = input_struct->input_mapped_select;
@@ -808,7 +813,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break;
case TMR_SELECT_CHANNEL_2:
tmr_x->cctrl_bit.c2en = FALSE;
tmr_x->cctrl_bit.c2en = FALSE;
tmr_x->cctrl_bit.c2p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c2cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm1_input_bit.c2c = input_struct->input_mapped_select;
@@ -818,7 +823,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break;
case TMR_SELECT_CHANNEL_3:
tmr_x->cctrl_bit.c3en = FALSE;
tmr_x->cctrl_bit.c3en = FALSE;
tmr_x->cctrl_bit.c3p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c3cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm2_input_bit.c3c = input_struct->input_mapped_select;
@@ -828,7 +833,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break;
case TMR_SELECT_CHANNEL_4:
tmr_x->cctrl_bit.c4en = FALSE;
tmr_x->cctrl_bit.c4en = FALSE;
tmr_x->cctrl_bit.c4p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cm2_input_bit.c4c = input_struct->input_mapped_select;
tmr_x->cm2_input_bit.c4df = input_struct->input_filter_value;
@@ -969,6 +974,8 @@ void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct,
switch(channel)
{
case TMR_SELECT_CHANNEL_1:
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c2en = FALSE;
if(input_struct->input_polarity_select == TMR_INPUT_RISING_EDGE)
{
/* set channel polarity */
@@ -1012,6 +1019,8 @@ void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct,
break;
case TMR_SELECT_CHANNEL_2:
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c2en = FALSE;
if(input_struct->input_polarity_select == TMR_INPUT_RISING_EDGE)
{
/* set channel polarity */
@@ -1609,6 +1618,9 @@ void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode
{
tmr_x->stctrl_bit.smsel = encoder_mode;
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c2en = FALSE;
/* set ic1 polarity */
tmr_x->cctrl_bit.c1p = (ic1_polarity & 0x1);
tmr_x->cctrl_bit.c1cp = (ic1_polarity >> 1);

View File

@@ -90,7 +90,7 @@ void usart_reset(usart_type* usart_x)
* this parameter can be one of the following values:
* - USART_DATA_8BITS
* - USART_DATA_9BITS.
* note
* note:
* - when parity check is disabled, the data bit width is the actual data bit number.
* - when parity check is enabled, the data bit width is the actual data bit number minus 1, and the MSB bit is replaced with the parity bit.
* @param stop_bit: stop bits transmitted
@@ -666,7 +666,6 @@ flag_status usart_interrupt_flag_get(usart_type* usart_x, uint32_t flag)
* - USART_PERR_FLAG, USART_FERR_FLAG, USART_NERR_FLAG, USART_ROERR_FLAG and USART_IDLEF_FLAG are cleared by software
* sequence: a read operation to usart sts register (usart_flag_get())
* followed by a read operation to usart dt register (usart_data_receive()).
* - USART_RDBF_FLAG can be also cleared by a read to the usart dt register(usart_data_receive()).
* - USART_TDC_FLAG can be also cleared by software sequence: a read operation to usart sts register (usart_flag_get())
* followed by a write operation to usart dt register (usart_data_transmit()).
* - USART_TDBE_FLAG is cleared only by a write to the usart dt register(usart_data_transmit()).
@@ -674,7 +673,7 @@ flag_status usart_interrupt_flag_get(usart_type* usart_x, uint32_t flag)
*/
void usart_flag_clear(usart_type* usart_x, uint32_t flag)
{
if(flag & (USART_PERR_FLAG | USART_FERR_FLAG | USART_NERR_FLAG | USART_ROERR_FLAG | USART_IDLEF_FLAG))
if(flag & (USART_PERR_FLAG | USART_FERR_FLAG | USART_NERR_FLAG | USART_ROERR_FLAG | USART_IDLEF_FLAG | USART_RDBF_FLAG))
{
UNUSED(usart_x->sts);
UNUSED(usart_x->dt);