update version to v2.1.7

This commit is contained in:
Artery-MCU
2024-01-25 10:05:33 +08:00
parent bd2ef6c955
commit 7c74102117
188 changed files with 6156 additions and 518 deletions

View File

@@ -132,14 +132,14 @@ void USBFS_L_CAN1_RX0_IRQHandler(void)
*/
void ACC_IRQHandler(void)
{
if(acc_flag_get(ACC_CALRDY_FLAG) != RESET)
if(acc_interrupt_flag_get(ACC_CALRDY_FLAG) != RESET)
{
at32_led_toggle(LED2);
/* clear acc calibration ready flag */
acc_flag_clear(ACC_CALRDY_FLAG);
}
if(acc_flag_get(ACC_RSLOST_FLAG) != RESET)
if(acc_interrupt_flag_get(ACC_RSLOST_FLAG) != RESET)
{
at32_led_toggle(LED3);

View File

@@ -10,7 +10,7 @@
<TargetName>combine_mode_ordinary_simult</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -141,7 +141,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma1_trans_complete_flag = 1;

View File

@@ -10,7 +10,7 @@
<TargetName>current_vref_value_check</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -10,7 +10,7 @@
<TargetName>exint_trigger_partitioned</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -142,7 +142,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag = 1;
@@ -156,7 +156,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
{
adc_flag_clear(ADC1, ADC_PCCE_FLAG);
if(preempt_trigger_count < 3)

View File

@@ -10,7 +10,7 @@
<TargetName>internal_temperature_sensor</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag++;

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag++;

View File

@@ -10,7 +10,7 @@
<TargetName>tmr_trigger_automatic_preempted</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag = 1;
@@ -157,7 +157,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
{
adc_flag_clear(ADC1, ADC_PCCE_FLAG);
if(preempt_conversion_count < 5)

View File

@@ -10,7 +10,7 @@
<TargetName>triple_adc_synchro_trigger</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma1_trans_complete_flag = 1;
@@ -157,7 +157,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void DMA2_Channel4_5_IRQHandler(void)
{
if(dma_flag_get(DMA2_FDT5_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA2_FDT5_FLAG) != RESET)
{
dma_flag_clear(DMA2_FDT5_FLAG);
dma2_trans_complete_flag = 1;

View File

@@ -10,7 +10,7 @@
<TargetName>voltage_monitoring</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -142,7 +142,7 @@ void SysTick_Handler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_VMOR_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_VMOR_FLAG) != RESET)
{
at32_led_toggle(LED3);
adc_flag_clear(ADC1, ADC_VMOR_FLAG);

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void TAMPER_IRQHandler(void)
{
if(bpr_flag_get(BPR_TAMPER_INTERRUPT_FLAG) != RESET)
if(bpr_interrupt_flag_get(BPR_TAMPER_INTERRUPT_FLAG) != RESET)
{
/* check if bpr registers are cleared */
if(bpr_reg_judge() == 0)

View File

@@ -108,7 +108,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -148,7 +148,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
if(rx_message_struct.standard_id == 0x400)
@@ -166,7 +166,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -133,7 +133,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -260,7 +260,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
if(test_result == 4)
{
@@ -288,7 +288,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -108,7 +108,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -148,7 +148,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
if(rx_message_struct.standard_id == 0x400)
@@ -164,7 +164,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -55,6 +55,26 @@ void systick_handler(void)
}
}
/**
* @brief config systick and enable interrupt.
* @param none
* @retval none
*/
static uint32_t systick_interrupt_config(uint32_t ticks)
{
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
{
return (1UL);
}
SysTick->LOAD = (uint32_t)(ticks - 1UL);
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
SysTick->VAL = 0UL;
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk;
return (0UL);
}
/**
* @brief main function.
* @param none
@@ -68,7 +88,7 @@ int main(void)
systick_clock_source_config(SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV);
/* config systick reload value and enable interrupt */
SysTick_Config(MS_TICK);
systick_interrupt_config(MS_TICK);
/* configure led */
at32_led_init(LED2);

View File

@@ -44,7 +44,7 @@ uint16_t counter = 0;
*/
void TMR1_OVF_TMR10_IRQHandler(void)
{
if(tmr_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
{
/* add user code... */
at32_led_toggle(LED3);

View File

@@ -47,7 +47,7 @@ uint16_t src_buffer[BUFFER_SIZE] = {0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x00
*/
void DMA2_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA2_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA2_FDT1_FLAG) != RESET)
{
/* turn led2/led3/led4 on */
at32_led_on(LED2);

View File

@@ -59,7 +59,7 @@ error_status buffer_compare(const uint32_t* pbuffer, uint32_t* pbuffer1, uint16_
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
data_counter_end = 0;
dma_flag_clear(DMA1_FDT1_FLAG);
@@ -157,4 +157,3 @@ int main(void)
/**
* @}
*/

View File

@@ -93,7 +93,7 @@ void exint_line0_config(void)
*/
void EXINT0_IRQHandler(void)
{
if(exint_flag_get(EXINT_LINE_0) != RESET)
if(exint_interrupt_flag_get(EXINT_LINE_0) != RESET)
{
at32_led_toggle(LED2);
at32_led_toggle(LED3);

View File

@@ -88,7 +88,7 @@ static void tmr1_config(void)
*/
void TMR1_OVF_TMR10_IRQHandler(void)
{
if(tmr_flag_get(TMR1,TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR1,TMR_OVF_FLAG) != RESET)
{
at32_led_toggle(LED2);
exint_software_interrupt_event_generate(EXINT_LINE_4);
@@ -103,7 +103,7 @@ void TMR1_OVF_TMR10_IRQHandler(void)
*/
void EXINT4_IRQHandler(void)
{
if(exint_flag_get(EXINT_LINE_4) != RESET)
if(exint_interrupt_flag_get(EXINT_LINE_4) != RESET)
{
at32_led_toggle(LED3);
at32_led_toggle(LED4);

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
*/
void SPI2_I2S2EXT_IRQHandler(void)
{
if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
if(spi_i2s_interrupt_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
{
i2s2_buffer_rx[rx_index++] = spi_i2s_data_receive(SPI2);
}
@@ -156,7 +156,7 @@ void SysTick_Handler(void)
*/
void SPI3_I2S3EXT_IRQHandler(void)
{
if(spi_i2s_flag_get(SPI3, SPI_I2S_TDBE_FLAG) != RESET)
if(spi_i2s_interrupt_flag_get(SPI3, SPI_I2S_TDBE_FLAG) != RESET)
{
spi_i2s_data_transmit(SPI3, i2s3_buffer_tx[tx_index++]);
if(tx_index == 32)

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void RTCAlarm_IRQHandler(void)
{
if(rtc_flag_get(RTC_TA_FLAG) != RESET)
if(rtc_interrupt_flag_get(RTC_TA_FLAG) != RESET)
{
/* clear exint line flag */
exint_flag_clear(EXINT_LINE_17);

View File

@@ -10,7 +10,7 @@
<TargetName>power_voltage_monitor</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void PVM_IRQHandler(void)
{
if(exint_flag_get(EXINT_LINE_16) != RESET)
if(exint_interrupt_flag_get(EXINT_LINE_16) != RESET)
{
/* clear exint line flag */
exint_flag_clear(EXINT_LINE_16);

View File

@@ -10,7 +10,7 @@
<TargetName>sleep_tmr2</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -139,7 +139,7 @@ void SysTick_Handler(void)
*/
void TMR2_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR2, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR2, TMR_OVF_FLAG) != RESET)
{
/* clear timer 2 ovf flag */
tmr_flag_clear(TMR2, TMR_OVF_FLAG);

View File

@@ -10,7 +10,7 @@
<TargetName>sleep_usart1</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -141,7 +141,7 @@ void SysTick_Handler(void)
*/
void USART1_IRQHandler(void)
{
if(usart_flag_get(USART1, USART_RDBF_FLAG) != RESET)
if(usart_interrupt_flag_get(USART1, USART_RDBF_FLAG) != RESET)
{
/* clear rdbf flag */
usart1_index = usart_data_receive(USART1);

View File

@@ -10,7 +10,7 @@
<TargetName>standby_rtc</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -139,7 +139,7 @@ void SysTick_Handler(void)
*/
void RTC_IRQHandler(void)
{
if(rtc_flag_get(RTC_TA_FLAG) != RESET)
if(rtc_interrupt_flag_get(RTC_TA_FLAG) != RESET)
{
at32_led_toggle(LED4);

View File

@@ -148,7 +148,7 @@ void SysTick_Handler(void)
*/
void RTC_IRQHandler(void)
{
if(rtc_flag_get(RTC_TS_FLAG) != RESET)
if(rtc_interrupt_flag_get(RTC_TS_FLAG) != RESET)
{
/* toggle led3 */
at32_led_toggle(LED3);
@@ -169,11 +169,11 @@ void TMR5_GLOBAL_IRQHandler(void)
{
uint32_t tmp = 0;
if(tmr_flag_get(TMR5, TMR_C4_FLAG) == SET)
if(tmr_interrupt_flag_get(TMR5, TMR_C4_FLAG) == SET)
{
tmpCC4[incrementvar_operationcomplete()] = (uint16_t)(TMR5->c4dt);
tmr_flag_get(TMR5, TMR_C4_FLAG);
tmr_interrupt_flag_get(TMR5, TMR_C4_FLAG);
if(getvar_operationcomplete() >= 2)
{

View File

@@ -99,11 +99,11 @@ sd_error_status_type sd_init(void)
sdio_reset(SDIOx);
/* power on */
status = sd_power_on();
if(status == SD_OK)
break;
}
if(status == SD_OK)
{
/* sdio card initialize */
@@ -281,7 +281,7 @@ sd_error_status_type sd_power_on(void)
while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
{
delay_ms(10);
/* send cmd55 before acmd41 */
sdio_command_init_struct.argument = 0x00;
sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
@@ -348,7 +348,7 @@ sd_error_status_type sd_power_on(void)
while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
{
delay_ms(10);
sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_MMC;
sdio_command_init_struct.cmd_index = SD_CMD_SEND_OP_COND;
sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
@@ -1779,7 +1779,7 @@ void SDIO2_IRQHandler(void)
*/
sd_error_status_type sd_irq_service(void)
{
if(sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
{
if(stop_flag == 1)
{
@@ -1804,7 +1804,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
@@ -1813,7 +1813,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
@@ -1822,7 +1822,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
@@ -1831,7 +1831,7 @@ sd_error_status_type sd_irq_service(void)
return(SD_RX_OVERRUN);
}
if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
@@ -1840,7 +1840,7 @@ sd_error_status_type sd_irq_service(void)
return(SD_TX_UNDERRUN);
}
if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);

View File

@@ -100,11 +100,11 @@ sd_error_status_type sd_init(void)
sdio_reset(SDIOx);
/* power on */
status = sd_power_on();
if(status == SD_OK)
break;
}
if(status == SD_OK)
{
/* sdio card initialize */
@@ -288,7 +288,7 @@ sd_error_status_type sd_power_on(void)
while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
{
delay_ms(10);
/* send cmd55 before acmd41 */
sdio_command_init_struct.argument = 0x00;
sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
@@ -355,7 +355,7 @@ sd_error_status_type sd_power_on(void)
while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
{
delay_ms(10);
sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_MMC;
sdio_command_init_struct.cmd_index = SD_CMD_SEND_OP_COND;
sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
@@ -1786,7 +1786,7 @@ void SDIO2_IRQHandler(void)
*/
sd_error_status_type sd_irq_service(void)
{
if(sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
{
if(stop_flag == 1)
{
@@ -1811,7 +1811,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
@@ -1820,7 +1820,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
@@ -1829,7 +1829,7 @@ sd_error_status_type sd_irq_service(void)
return transfer_error;
}
if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
@@ -1838,7 +1838,7 @@ sd_error_status_type sd_irq_service(void)
return(SD_RX_OVERRUN);
}
if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
@@ -1847,7 +1847,7 @@ sd_error_status_type sd_irq_service(void)
return(SD_TX_UNDERRUN);
}
if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
if(sdio_interrupt_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
{
/* clear flag */
sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);

View File

@@ -145,7 +145,7 @@ void SysTick_Handler(void)
*/
void SPI1_IRQHandler(void)
{
if(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
if(spi_i2s_interrupt_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
{
spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
if(tx_index == BUFFERSIZE)
@@ -162,7 +162,7 @@ void SysTick_Handler(void)
*/
void SPI2_I2S2EXT_IRQHandler(void)
{
if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
if(spi_i2s_interrupt_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
{
spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
}

View File

@@ -10,7 +10,7 @@
<TargetName>halfduplex_transceiver_switch</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -147,28 +147,22 @@ void SysTick_Handler(void)
*/
void SPI1_IRQHandler(void)
{
if(SPI1->ctrl2_bit.tdbeie != RESET)
if(spi_i2s_interrupt_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
{
if(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
if(tx_index == BUFFERSIZE)
{
spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
if(tx_index == BUFFERSIZE)
{
spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
}
spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
}
}
if(SPI1->ctrl2_bit.rdbfie != RESET)
if(spi_i2s_interrupt_flag_get(SPI1, SPI_I2S_RDBF_FLAG) != RESET)
{
if(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) != RESET)
spi_enable(SPI1, FALSE);
spi1_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI1);
spi_enable(SPI1, TRUE);
if(rx_index == BUFFERSIZE)
{
spi_enable(SPI1, FALSE);
spi1_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI1);
spi_enable(SPI1, TRUE);
if(rx_index == BUFFERSIZE)
{
spi_i2s_interrupt_enable(SPI1, SPI_I2S_RDBF_INT, FALSE);
}
spi_i2s_interrupt_enable(SPI1, SPI_I2S_RDBF_INT, FALSE);
}
}
}
@@ -180,23 +174,17 @@ void SysTick_Handler(void)
*/
void SPI2_I2S2EXT_IRQHandler(void)
{
if(SPI2->ctrl2_bit.tdbeie != RESET)
if(spi_i2s_interrupt_flag_get(SPI2, SPI_I2S_TDBE_FLAG) != RESET)
{
if(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) != RESET)
spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index++]);
if(tx_index == BUFFERSIZE)
{
spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index++]);
if(tx_index == BUFFERSIZE)
{
spi_i2s_interrupt_enable(SPI2, SPI_I2S_TDBE_INT, FALSE);
}
spi_i2s_interrupt_enable(SPI2, SPI_I2S_TDBE_INT, FALSE);
}
}
if(SPI2->ctrl2_bit.rdbfie != RESET)
if(spi_i2s_interrupt_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
{
if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
{
spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
}
spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
}
}

View File

@@ -130,7 +130,7 @@ int main(void)
dma_init_struct.memory_base_addr = (uint32_t)src_buffer;
dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
dma_init_struct.memory_inc_enable = TRUE;
dma_init_struct.peripheral_base_addr = (uint32_t)0x40012C3C;
dma_init_struct.peripheral_base_addr = (uint32_t)&TMR1->c3dt;
dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
dma_init_struct.peripheral_inc_enable = FALSE;
dma_init_struct.priority = DMA_PRIORITY_MEDIUM;

View File

@@ -111,7 +111,7 @@ int main(void)
dma_init_struct.memory_base_addr = (uint32_t)src_buffer;
dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
dma_init_struct.memory_inc_enable = TRUE;
dma_init_struct.peripheral_base_addr = (uint32_t)0x40012C4C;
dma_init_struct.peripheral_base_addr = (uint32_t)&TMR1->dmadt;
dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
dma_init_struct.peripheral_inc_enable = FALSE;
dma_init_struct.priority = DMA_PRIORITY_MEDIUM;

View File

@@ -136,7 +136,7 @@ int main(void)
*/
void TMR2_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR2, TMR_TRIGGER_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR2, TMR_TRIGGER_FLAG) != RESET)
{
GPIOA->odt ^= GPIO_PINS_8;
tmr_flag_clear(TMR2, TMR_TRIGGER_FLAG);

View File

@@ -63,7 +63,7 @@ void delay(uint32_t time)
*/
void TMR3_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR3, TMR_C2_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR3, TMR_C2_FLAG) != RESET)
{
tmr_flag_clear(TMR3, TMR_C2_FLAG);
if(capturenumber == 0)
@@ -84,7 +84,7 @@ void TMR3_GLOBAL_IRQHandler(void)
}
else
{
capture = ((0xFFFF - ic3readvalue1) + ic3readvalue2);
capture = ((0x10000 - ic3readvalue1) + ic3readvalue2);
}
/* frequency computation */

View File

@@ -137,7 +137,7 @@ void SysTick_Handler(void)
*/
void TMR2_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR2, TMR_C1_FLAG) != RESET)
{
/* clear tmr2 channel1 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C1_FLAG);
@@ -145,7 +145,7 @@ void TMR2_GLOBAL_IRQHandler(void)
/* pc.06 turnoff after 1000 ms */
gpio_bits_reset(GPIOC, GPIO_PINS_6);
}
else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C2_FLAG) != RESET)
{
/* clear tmr2 channel2 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C2_FLAG);
@@ -153,7 +153,7 @@ void TMR2_GLOBAL_IRQHandler(void)
/* pc.07 turnoff after 500 ms */
gpio_bits_reset(GPIOC, GPIO_PINS_7);
}
else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C3_FLAG) != RESET)
{
/* clear tmr2 channel3 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C3_FLAG);

View File

@@ -137,7 +137,7 @@ void SysTick_Handler(void)
*/
void TMR2_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR2, TMR_C1_FLAG) != RESET)
{
/* clear tmr2 channel1 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C1_FLAG);
@@ -145,7 +145,7 @@ void TMR2_GLOBAL_IRQHandler(void)
/* pc.06 turnoff after 1000 ms */
gpio_bits_reset(GPIOC, GPIO_PINS_6);
}
else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C2_FLAG) != RESET)
{
/* clear tmr2 channel2 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C2_FLAG);
@@ -153,7 +153,7 @@ void TMR2_GLOBAL_IRQHandler(void)
/* pc.07 turnoff after 500 ms */
gpio_bits_reset(GPIOC, GPIO_PINS_7);
}
else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C3_FLAG) != RESET)
{
/* clear tmr2 channel3 interrupt pending bit */
tmr_flag_clear(TMR2, TMR_C3_FLAG);

View File

@@ -145,7 +145,7 @@ void SysTick_Handler(void)
void TMR3_GLOBAL_IRQHandler(void)
{
/* TMR3_CH1 toggling with frequency = 183.1 Hz */
if(tmr_flag_get(TMR3, TMR_C1_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR3, TMR_C1_FLAG) != RESET)
{
tmr_flag_clear(TMR3, TMR_C1_FLAG );
capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_1);
@@ -153,7 +153,7 @@ void TMR3_GLOBAL_IRQHandler(void)
}
/* TMR3_CH2 toggling with frequency = 366.2 Hz */
if(tmr_flag_get(TMR3, TMR_C2_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR3, TMR_C2_FLAG) != RESET)
{
tmr_flag_clear(TMR3, TMR_C2_FLAG);
capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_2);
@@ -161,7 +161,7 @@ void TMR3_GLOBAL_IRQHandler(void)
}
/* TMR3_CH3 toggling with frequency = 732.4 Hz */
if(tmr_flag_get(TMR3, TMR_C3_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR3, TMR_C3_FLAG) != RESET)
{
tmr_flag_clear(TMR3, TMR_C3_FLAG);
capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_3);
@@ -169,7 +169,7 @@ void TMR3_GLOBAL_IRQHandler(void)
}
/* TMR3_CH4 toggling with frequency = 1464.8 Hz */
if(tmr_flag_get(TMR3, TMR_C4_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR3, TMR_C4_FLAG) != RESET)
{
tmr_flag_clear(TMR3, TMR_C4_FLAG);
capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_4);

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
void TMR1_BRK_TMR9_IRQHandler(void)
{
/* TMR9_CH1 toggling with frequency = 366.2 Hz */
if(tmr_flag_get(TMR9, TMR_C1_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR9, TMR_C1_FLAG) != RESET)
{
tmr_flag_clear(TMR9, TMR_C1_FLAG );
capture = tmr_channel_value_get(TMR9, TMR_SELECT_CHANNEL_1);
@@ -151,7 +151,7 @@ void TMR1_BRK_TMR9_IRQHandler(void)
}
/* TMR9_CH2 toggling with frequency = 732.4 Hz */
if(tmr_flag_get(TMR9, TMR_C2_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR9, TMR_C2_FLAG) != RESET)
{
tmr_flag_clear(TMR9, TMR_C2_FLAG);
capture = tmr_channel_value_get(TMR9, TMR_SELECT_CHANNEL_2);

View File

@@ -33,9 +33,6 @@
* @{
*/
#define TMR1_C1DT_ADDRESS 0x40012C34
#define TMR1_C2DT_ADDRESS 0x40012C38
#define SAMPLING_NUM 1000
tmr_input_config_type tmr_ic_init_structure;
@@ -131,7 +128,7 @@ int main(void)
dma_reset(DMA1_CHANNEL2);
dma_default_para_init(&dma_init_structure);
dma_init_structure.peripheral_base_addr = (uint32_t)TMR1_C1DT_ADDRESS;
dma_init_structure.peripheral_base_addr = (uint32_t)&TMR1->c1dt;
dma_init_structure.memory_base_addr = (uint32_t)buffer_cc1;
dma_init_structure.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
dma_init_structure.buffer_size = SAMPLING_NUM;
@@ -144,7 +141,7 @@ int main(void)
dma_init(DMA1_CHANNEL2, &dma_init_structure);
dma_reset(DMA1_CHANNEL3);
dma_init_structure.peripheral_base_addr = (uint32_t)TMR1_C2DT_ADDRESS;
dma_init_structure.peripheral_base_addr = (uint32_t)&TMR1->c2dt;
dma_init_structure.memory_base_addr = (uint32_t)buffer_cc2;
dma_init(DMA1_CHANNEL3, &dma_init_structure);

View File

@@ -139,7 +139,7 @@ void SysTick_Handler(void)
void TMR2_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR2, TMR_C1_FLAG) != RESET)
{
tmr_flag_clear(TMR2, TMR_C1_FLAG );
@@ -148,7 +148,7 @@ void TMR2_GLOBAL_IRQHandler(void)
capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_1);
tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, capture + ccr1_val);
}
else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C2_FLAG) != RESET)
{
tmr_flag_clear(TMR2, TMR_C2_FLAG);
@@ -157,7 +157,7 @@ void TMR2_GLOBAL_IRQHandler(void)
capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_2);
tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, capture + ccr2_val);
}
else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
else if(tmr_interrupt_flag_get(TMR2, TMR_C3_FLAG) != RESET)
{
tmr_flag_clear(TMR2, TMR_C3_FLAG);

View File

@@ -67,7 +67,7 @@ void clkout_config(void)
*/
void TMR1_OVF_TMR10_IRQHandler(void)
{
if(tmr_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
{
/* add user code... */
at32_led_toggle(LED3);

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void USART2_IRQHandler(void)
{
if(usart_flag_get(USART2, USART_IDLEF_FLAG))
if(usart_interrupt_flag_get(USART2, USART_IDLEF_FLAG))
{
usart_data_receive(USART2);
at32_led_on(LED2);

View File

@@ -148,33 +148,27 @@ void SysTick_Handler(void)
*/
void USART2_IRQHandler(void)
{
if(USART2->ctrl1_bit.rdbfien != RESET)
if(usart_interrupt_flag_get(USART2, USART_RDBF_FLAG) != RESET)
{
if(usart_flag_get(USART2, USART_RDBF_FLAG) != RESET)
{
/* read one byte from the receive data register */
usart2_rx_buffer[usart2_rx_counter++] = usart_data_receive(USART2);
/* read one byte from the receive data register */
usart2_rx_buffer[usart2_rx_counter++] = usart_data_receive(USART2);
if(usart2_rx_counter == usart3_tx_buffer_size)
{
/* disable the usart2 receive interrupt */
usart_interrupt_enable(USART2, USART_RDBF_INT, FALSE);
}
if(usart2_rx_counter == usart3_tx_buffer_size)
{
/* disable the usart2 receive interrupt */
usart_interrupt_enable(USART2, USART_RDBF_INT, FALSE);
}
}
if(USART2->ctrl1_bit.tdbeien != RESET)
{
if(usart_flag_get(USART2, USART_TDBE_FLAG) != RESET)
{
/* write one byte to the transmit data register */
usart_data_transmit(USART2, usart2_tx_buffer[usart2_tx_counter++]);
if(usart2_tx_counter == usart2_tx_buffer_size)
{
/* disable the usart2 transmit interrupt */
usart_interrupt_enable(USART2, USART_TDBE_INT, FALSE);
}
if(usart_interrupt_flag_get(USART2, USART_TDBE_FLAG) != RESET)
{
/* write one byte to the transmit data register */
usart_data_transmit(USART2, usart2_tx_buffer[usart2_tx_counter++]);
if(usart2_tx_counter == usart2_tx_buffer_size)
{
/* disable the usart2 transmit interrupt */
usart_interrupt_enable(USART2, USART_TDBE_INT, FALSE);
}
}
}
@@ -186,33 +180,27 @@ void USART2_IRQHandler(void)
*/
void USART3_IRQHandler(void)
{
if(USART3->ctrl1_bit.rdbfien != RESET)
if(usart_interrupt_flag_get(USART3, USART_RDBF_FLAG) != RESET)
{
if(usart_flag_get(USART3, USART_RDBF_FLAG) != RESET)
{
/* read one byte from the receive data register */
usart3_rx_buffer[usart3_rx_counter++] = usart_data_receive(USART3);
/* read one byte from the receive data register */
usart3_rx_buffer[usart3_rx_counter++] = usart_data_receive(USART3);
if(usart3_rx_counter == usart2_tx_buffer_size)
{
/* disable the usart3 receive interrupt */
usart_interrupt_enable(USART3, USART_RDBF_INT, FALSE);
}
if(usart3_rx_counter == usart2_tx_buffer_size)
{
/* disable the usart3 receive interrupt */
usart_interrupt_enable(USART3, USART_RDBF_INT, FALSE);
}
}
if(USART3->ctrl1_bit.tdbeien != RESET)
{
if(usart_flag_get(USART3, USART_TDBE_FLAG) != RESET)
{
/* write one byte to the transmit data register */
usart_data_transmit(USART3, usart3_tx_buffer[usart3_tx_counter++]);
if(usart3_tx_counter == usart3_tx_buffer_size)
{
/* disable the usart3 transmit interrupt */
usart_interrupt_enable(USART3, USART_TDBE_INT, FALSE);
}
if(usart_interrupt_flag_get(USART3, USART_TDBE_FLAG) != RESET)
{
/* write one byte to the transmit data register */
usart_data_transmit(USART3, usart3_tx_buffer[usart3_tx_counter++]);
if(usart3_tx_counter == usart3_tx_buffer_size)
{
/* disable the usart3 transmit interrupt */
usart_interrupt_enable(USART3, USART_TDBE_INT, FALSE);
}
}
}

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void USART3_IRQHandler(void)
{
if(usart_flag_get(USART3, USART_RDBF_FLAG) != RESET)
if(usart_interrupt_flag_get(USART3, USART_RDBF_FLAG) != RESET)
{
usart3_rx_buffer[rx_counter++] = usart_data_receive(USART3);
}

View File

@@ -5,11 +5,11 @@
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -37,7 +37,7 @@
#define RS485_BUFFER_SIZE 128
uint8_t rs485_buffer_rx[RS485_BUFFER_SIZE];
uint8_t rs485_buffer_rx_cnt = 0;
uint8_t rs485_buffer_rx_cnt = 0;
/**
* @brief rs485 configiguration.
@@ -61,29 +61,29 @@ static void rs485_config(void)
gpio_init_struct.gpio_pins = GPIO_PINS_2;
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
gpio_init(GPIOA, &gpio_init_struct);
gpio_init_struct.gpio_pins = GPIO_PINS_3;
gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
gpio_init_struct.gpio_pull = GPIO_PULL_UP;
gpio_init(GPIOA, &gpio_init_struct);
gpio_init_struct.gpio_pins = GPIO_PINS_1;
gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
gpio_init(GPIOA, &gpio_init_struct);
gpio_bits_reset(GPIOA, GPIO_PINS_1);
/* configure uart2 param */
usart_init(USART2, RS485_BAUDRATE, USART_DATA_8BITS, USART_STOP_1_BIT);
usart_flag_clear(USART2, USART_RDBF_FLAG);
usart_interrupt_enable(USART2, USART_RDBF_INT, TRUE);
usart_receiver_enable(USART2, TRUE);
usart_transmitter_enable(USART2, TRUE);
usart_enable(USART2, TRUE);
nvic_irq_enable(USART2_IRQn, 1, 0);
}
@@ -113,13 +113,13 @@ int main(void)
{
char str[]="start test..\r\n";
u8 len = 0;
system_clock_config();
at32_board_init();
nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
rs485_config();
len = sizeof(str);
rs485_send_data((u8*)str, len);
while(1)
@@ -131,7 +131,7 @@ int main(void)
rs485_send_data(rs485_buffer_rx, rs485_buffer_rx_cnt);
rs485_buffer_rx_cnt = 0;
usart_interrupt_enable(USART2, USART_RDBF_INT, TRUE);
}
}
}
}
@@ -143,8 +143,8 @@ int main(void)
void USART2_IRQHandler(void)
{
uint16_t tmp;
if(usart_flag_get(USART2, USART_RDBF_FLAG) != RESET)
if(usart_interrupt_flag_get(USART2, USART_RDBF_FLAG) != RESET)
{
tmp = usart_data_receive(USART2);
if(rs485_buffer_rx_cnt < RS485_BUFFER_SIZE)
@@ -156,8 +156,8 @@ void USART2_IRQHandler(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -164,7 +164,7 @@ void EXINT9_5_IRQHandler(void)
void SC_USART_IRQHandler(void)
{
/* if the sc_usart detects a parity error */
if(usart_flag_get(SC_USART, USART_PERR_FLAG) != RESET)
if(usart_interrupt_flag_get(SC_USART, USART_PERR_FLAG) != RESET)
{
/* enable sc_usart rdbf interrupt (until receiving the corrupted byte) */
usart_interrupt_enable(SC_USART, USART_RDBF_INT, TRUE);
@@ -172,7 +172,7 @@ void SC_USART_IRQHandler(void)
usart_data_receive(SC_USART);
}
if(usart_flag_get(SC_USART, USART_RDBF_FLAG) != RESET)
if(usart_interrupt_flag_get(SC_USART, USART_RDBF_FLAG) != RESET)
{
/* disable sc_usart rdbf interrupt */
usart_interrupt_enable(SC_USART, USART_RDBF_INT, FALSE);

View File

@@ -142,7 +142,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG))
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG))
{
usart2_tx_dma_status = 1;
dma_flag_clear(DMA1_FDT1_FLAG);
@@ -157,7 +157,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void DMA1_Channel2_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT2_FLAG))
if(dma_interrupt_flag_get(DMA1_FDT2_FLAG))
{
usart2_rx_dma_status = 1;
dma_flag_clear(DMA1_FDT2_FLAG);
@@ -172,7 +172,7 @@ void DMA1_Channel2_IRQHandler(void)
*/
void DMA1_Channel3_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT3_FLAG))
if(dma_interrupt_flag_get(DMA1_FDT3_FLAG))
{
usart3_tx_dma_status = 1;
dma_flag_clear(DMA1_FDT3_FLAG);
@@ -187,7 +187,7 @@ void DMA1_Channel3_IRQHandler(void)
*/
void DMA1_Channel4_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT4_FLAG))
if(dma_interrupt_flag_get(DMA1_FDT4_FLAG))
{
usart3_rx_dma_status = 1;
dma_flag_clear(DMA1_FDT4_FLAG);

View File

@@ -205,6 +205,10 @@ void audio_codec_set_mic_volume(uint16_t volume)
{
/* wm8988 adc have 256 steps */
audio_codec.mic_volume = volume;
if(audio_codec.mic_volume > 0xFF)
{
audio_codec.mic_volume = 0xFF;
}
}
/**
@@ -649,13 +653,13 @@ void DMA1_Channel3_IRQHandler(void)
uint16_t half_size = audio_codec.spk_tx_size;
uint16_t *pdst;
if(dma_flag_get(DMA1_HDT3_FLAG) == SET)
if(dma_interrupt_flag_get(DMA1_HDT3_FLAG) == SET)
{
//copy_buff(audio_codec.spk_buffer, audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
pdst = spk_dma_buffer;
dma_flag_clear(DMA1_HDT3_FLAG);
}
else if(dma_flag_get(DMA1_FDT3_FLAG) == SET)
else if(dma_interrupt_flag_get(DMA1_FDT3_FLAG) == SET)
{
//copy_buff(&audio_codec.spk_buffer[half_size], audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
pdst = spk_dma_buffer + half_size;
@@ -724,12 +728,12 @@ void DMA1_Channel4_IRQHandler(void)
uint16_t *psrc;
uint16_t len = audio_codec.mic_rx_size << 1;
if(dma_flag_get(DMA1_HDT4_FLAG) == SET)
if(dma_interrupt_flag_get(DMA1_HDT4_FLAG) == SET)
{
dma_flag_clear(DMA1_HDT4_FLAG);
psrc = mic_dma_buffer;
}
else if(dma_flag_get(DMA1_FDT4_FLAG) == SET)
else if(dma_interrupt_flag_get(DMA1_FDT4_FLAG) == SET)
{
psrc = mic_dma_buffer + audio_codec.mic_rx_size;
dma_flag_clear(DMA1_FDT4_FLAG);
@@ -947,7 +951,3 @@ error_status audio_codec_loop(void)
/**
* @}
*/

View File

@@ -205,6 +205,10 @@ void audio_codec_set_mic_volume(uint16_t volume)
{
/* wm8988 adc have 256 steps */
audio_codec.mic_volume = volume;
if(audio_codec.mic_volume > 0xFF)
{
audio_codec.mic_volume = 0xFF;
}
}
/**
@@ -651,13 +655,13 @@ void DMA1_Channel3_IRQHandler(void)
uint16_t half_size = audio_codec.spk_tx_size;
uint16_t *pdst;
if(dma_flag_get(DMA1_HDT3_FLAG) == SET)
if(dma_interrupt_flag_get(DMA1_HDT3_FLAG) == SET)
{
//copy_buff(audio_codec.spk_buffer, audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
pdst = spk_dma_buffer;
dma_flag_clear(DMA1_HDT3_FLAG);
}
else if(dma_flag_get(DMA1_FDT3_FLAG) == SET)
else if(dma_interrupt_flag_get(DMA1_FDT3_FLAG) == SET)
{
//copy_buff(&audio_codec.spk_buffer[half_size], audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
pdst = spk_dma_buffer + half_size;
@@ -726,12 +730,12 @@ void DMA1_Channel4_IRQHandler(void)
uint16_t *psrc;
uint16_t len = audio_codec.mic_rx_size << 1;
if(dma_flag_get(DMA1_HDT4_FLAG) == SET)
if(dma_interrupt_flag_get(DMA1_HDT4_FLAG) == SET)
{
dma_flag_clear(DMA1_HDT4_FLAG);
psrc = mic_dma_buffer;
}
else if(dma_flag_get(DMA1_FDT4_FLAG) == SET)
else if(dma_interrupt_flag_get(DMA1_FDT4_FLAG) == SET)
{
psrc = mic_dma_buffer + audio_codec.mic_rx_size;
dma_flag_clear(DMA1_FDT4_FLAG);
@@ -949,7 +953,3 @@ error_status audio_codec_loop(void)
/**
* @}
*/

View File

@@ -281,7 +281,7 @@ uint16_t usart_receive_data(void)
*/
void USART2_IRQHandler(void)
{
if(usart_flag_get(USART2, USART_RDBF_FLAG) != RESET)
if(usart_interrupt_flag_get(USART2, USART_RDBF_FLAG) != RESET)
{
/* read one byte from the receive data register */
usart_rx_buffer[hw_usart_rx_index] = usart_data_receive(USART2);
@@ -320,7 +320,7 @@ void usb_usart_config( linecoding_type linecoding)
default :
break;
}
/* parity */
switch(linecoding.parity)
{
@@ -340,7 +340,7 @@ void usb_usart_config( linecoding_type linecoding)
default :
break;
}
if(USART_PARITY_NONE == usart_parity_select)
{
/* data bits */
@@ -359,7 +359,7 @@ void usb_usart_config( linecoding_type linecoding)
break;
default :
break;
}
}
}
else
{
@@ -381,7 +381,7 @@ void usb_usart_config( linecoding_type linecoding)
break;
default :
break;
}
}
}
nvic_irq_enable(USART2_IRQn, 0, 0);

View File

@@ -0,0 +1,44 @@
/**
**************************************************************************
* @file at32f403a_407_clock.h
* @brief header file of clock program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __AT32F403A_407_CLOCK_H
#define __AT32F403A_407_CLOCK_H
#ifdef __cplusplus
extern "C" {
#endif
/* includes ------------------------------------------------------------------*/
#include "at32f403a_407.h"
/* exported functions ------------------------------------------------------- */
void system_clock_config(void);
#ifdef __cplusplus
}
#endif
#endif /* __AT32F403A_407_CLOCK_H */

View File

@@ -0,0 +1,162 @@
/**
**************************************************************************
* @file at32f403a_407_conf.h
* @brief at32f403a_407 config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __AT32F403A_407_CONF_H
#define __AT32F403A_407_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief in the following line adjust the value of high speed external crystal (hext)
* used in your application
*
* tip: to avoid modifying this file each time you need to use different hext, you
* can define the hext value in your toolchain compiler preprocessor.
*
*/
#if !defined HEXT_VALUE
#define HEXT_VALUE ((uint32_t)8000000) /*!< value of the high speed external crystal in hz */
#endif
/**
* @brief in the following line adjust the high speed external crystal (hext) startup
* timeout value
*/
#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000) /*!< time out for hext start up */
#define HICK_VALUE ((uint32_t)8000000) /*!< value of the high speed internal clock in hz */
#define LEXT_VALUE ((uint32_t)32768) /*!< value of the low speed external clock in hz */
/* module define -------------------------------------------------------------*/
#define CRM_MODULE_ENABLED
#define TMR_MODULE_ENABLED
#define RTC_MODULE_ENABLED
#define BPR_MODULE_ENABLED
#define GPIO_MODULE_ENABLED
#define I2C_MODULE_ENABLED
#define USART_MODULE_ENABLED
#define PWC_MODULE_ENABLED
#define CAN_MODULE_ENABLED
#define ADC_MODULE_ENABLED
#define DAC_MODULE_ENABLED
#define SPI_MODULE_ENABLED
#define DMA_MODULE_ENABLED
#define DEBUG_MODULE_ENABLED
#define FLASH_MODULE_ENABLED
#define CRC_MODULE_ENABLED
#define WWDT_MODULE_ENABLED
#define WDT_MODULE_ENABLED
#define EXINT_MODULE_ENABLED
#define SDIO_MODULE_ENABLED
#define XMC_MODULE_ENABLED
#define USB_MODULE_ENABLED
#define ACC_MODULE_ENABLED
#define MISC_MODULE_ENABLED
#define EMAC_MODULE_ENABLED
/* includes ------------------------------------------------------------------*/
#ifdef CRM_MODULE_ENABLED
#include "at32f403a_407_crm.h"
#endif
#ifdef TMR_MODULE_ENABLED
#include "at32f403a_407_tmr.h"
#endif
#ifdef RTC_MODULE_ENABLED
#include "at32f403a_407_rtc.h"
#endif
#ifdef BPR_MODULE_ENABLED
#include "at32f403a_407_bpr.h"
#endif
#ifdef GPIO_MODULE_ENABLED
#include "at32f403a_407_gpio.h"
#endif
#ifdef I2C_MODULE_ENABLED
#include "at32f403a_407_i2c.h"
#endif
#ifdef USART_MODULE_ENABLED
#include "at32f403a_407_usart.h"
#endif
#ifdef PWC_MODULE_ENABLED
#include "at32f403a_407_pwc.h"
#endif
#ifdef CAN_MODULE_ENABLED
#include "at32f403a_407_can.h"
#endif
#ifdef ADC_MODULE_ENABLED
#include "at32f403a_407_adc.h"
#endif
#ifdef DAC_MODULE_ENABLED
#include "at32f403a_407_dac.h"
#endif
#ifdef SPI_MODULE_ENABLED
#include "at32f403a_407_spi.h"
#endif
#ifdef DMA_MODULE_ENABLED
#include "at32f403a_407_dma.h"
#endif
#ifdef DEBUG_MODULE_ENABLED
#include "at32f403a_407_debug.h"
#endif
#ifdef FLASH_MODULE_ENABLED
#include "at32f403a_407_flash.h"
#endif
#ifdef CRC_MODULE_ENABLED
#include "at32f403a_407_crc.h"
#endif
#ifdef WWDT_MODULE_ENABLED
#include "at32f403a_407_wwdt.h"
#endif
#ifdef WDT_MODULE_ENABLED
#include "at32f403a_407_wdt.h"
#endif
#ifdef EXINT_MODULE_ENABLED
#include "at32f403a_407_exint.h"
#endif
#ifdef SDIO_MODULE_ENABLED
#include "at32f403a_407_sdio.h"
#endif
#ifdef XMC_MODULE_ENABLED
#include "at32f403a_407_xmc.h"
#endif
#ifdef ACC_MODULE_ENABLED
#include "at32f403a_407_acc.h"
#endif
#ifdef MISC_MODULE_ENABLED
#include "at32f403a_407_misc.h"
#endif
#ifdef USB_MODULE_ENABLED
#include "at32f403a_407_usb.h"
#endif
#ifdef EMAC_MODULE_ENABLED
#include "at32f403a_407_emac.h"
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,56 @@
/**
**************************************************************************
* @file at32f403a_407_int.h
* @brief header file of main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __AT32F403A_407_INT_H
#define __AT32F403A_407_INT_H
#ifdef __cplusplus
extern "C" {
#endif
/* includes ------------------------------------------------------------------*/
#include "at32f403a_407.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

View File

@@ -0,0 +1,119 @@
/**
**************************************************************************
* @file usb_conf.h
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_CONF_H
#define __USB_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
#include "at32f403a_407.h"
#include "at32f403a_407_board.h"
#include "stdio.h"
/** @addtogroup AT32F403A_periph_examples
* @{
*/
/** @addtogroup 403A_USB_device_winusb
* @{
*/
/**
* @brief usb endpoint max num define
*/
#ifndef USB_EPT_MAX_NUM
#define USB_EPT_MAX_NUM 8 /*!< usb device support endpoint number */
#endif
/**
* @brief usb buffer extend to 768-1280 bytes
*/
//#define USB_BUFFER_SIZE_EX /*!< usb enable extend buffer */
/**
* @brief auto malloc usb endpoint buffer
*/
//#define USB_EPT_AUTO_MALLOC_BUFFER /*!< usb auto malloc endpoint tx and rx buffer */
#ifndef USB_EPT_AUTO_MALLOC_BUFFER
/**
* @brief user custom endpoint buffer
* EPTn_TX_ADDR, EPTn_RX_ADDR must less than usb buffer size
*/
/* ept0 tx start address 0x40, size 0x40,
so rx start address is 0x40 + 0x40 = 0x80 */
#define EPT0_TX_ADDR 0x40 /*!< usb endpoint 0 tx buffer address offset */
#define EPT0_RX_ADDR 0x80 /*!< usb endpoint 0 rx buffer address offset */
#define EPT1_TX_ADDR 0xC0 /*!< usb endpoint 1 tx buffer address offset */
#define EPT1_RX_ADDR 0x100 /*!< usb endpoint 1 rx buffer address offset */
#define EPT2_TX_ADDR 0x140 /*!< usb endpoint 2 tx buffer address offset */
#define EPT2_RX_ADDR 0x180 /*!< usb endpoint 2 rx buffer address offset */
#define EPT3_TX_ADDR 0x00 /*!< usb endpoint 3 tx buffer address offset */
#define EPT3_RX_ADDR 0x00 /*!< usb endpoint 3 rx buffer address offset */
#define EPT4_TX_ADDR 0x00 /*!< usb endpoint 4 tx buffer address offset */
#define EPT4_RX_ADDR 0x00 /*!< usb endpoint 4 rx buffer address offset */
#define EPT5_TX_ADDR 0x00 /*!< usb endpoint 5 tx buffer address offset */
#define EPT5_RX_ADDR 0x00 /*!< usb endpoint 5 rx buffer address offset */
#define EPT6_TX_ADDR 0x00 /*!< usb endpoint 6 tx buffer address offset */
#define EPT6_RX_ADDR 0x00 /*!< usb endpoint 6 rx buffer address offset */
#define EPT7_TX_ADDR 0x00 /*!< usb endpoint 7 tx buffer address offset */
#define EPT7_RX_ADDR 0x00 /*!< usb endpoint 7 rx buffer address offset */
#endif
/**
* @brief support winusb
*/
#define USBD_SUPPORT_WINUSB 1
void usb_delay_ms(uint32_t ms);
void usb_delay_us(uint32_t us);
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,672 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
</Extensions>
<DaveTm>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DaveTm>
<Target>
<TargetName>winusb</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<OPTTT>
<gFlags>0</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
<FlashByte>65535</FlashByte>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
</OPTHX>
<OPTLEX>
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\listings\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
<CreateAListing>1</CreateAListing>
<CreateLListing>1</CreateLListing>
<CreateIListing>0</CreateIListing>
<AsmCond>1</AsmCond>
<AsmSymb>1</AsmSymb>
<AsmXref>0</AsmXref>
<CCond>1</CCond>
<CCode>0</CCode>
<CListInc>0</CListInc>
<CSymb>0</CSymb>
<LinkerCodeListing>0</LinkerCodeListing>
</ListingPage>
<OPTXL>
<LMap>1</LMap>
<LComments>1</LComments>
<LGenerateSymbols>1</LGenerateSymbols>
<LLibSym>1</LLibSym>
<LLines>1</LLines>
<LLocSym>1</LLocSym>
<LPubSym>1</LPubSym>
<LXref>0</LXref>
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>0</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<sLdApp>1</sLdApp>
<sGomain>1</sGomain>
<sRbreak>1</sRbreak>
<sRwatch>1</sRwatch>
<sRmem>1</sRmem>
<sRfunc>1</sRfunc>
<sRbox>1</sRbox>
<tLdApp>1</tLdApp>
<tGomain>1</tGomain>
<tRbreak>1</tRbreak>
<tRwatch>1</tRwatch>
<tRmem>1</tRmem>
<tRfunc>0</tRfunc>
<tRbox>1</tRbox>
<tRtrace>1</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>0</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0AT32F403A_1024 -FS08000000 -FL0100000 -FP0($$Device:-AT32F403AVGT7$Flash\AT32F403A_1024.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>0</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
<AscS1>0</AscS1>
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
</TargetOption>
</Target>
<Group>
<GroupName>user</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\src\at32f403a_407_clock.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_clock.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\src\at32f403a_407_int.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_int.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>
<FilenameWithoutPath>main.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>bsp</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\at32f403a_407_board\at32f403a_407_board.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_board.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>firmware</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_acc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_acc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>6</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_adc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_adc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>7</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_bpr.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_bpr.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>8</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_can.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_can.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>9</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_crc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_crc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>10</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_crm.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_crm.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>11</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_dac.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_dac.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>12</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_debug.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_debug.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>13</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_dma.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_dma.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>14</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_emac.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_emac.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>15</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_exint.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_exint.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>16</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_flash.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_flash.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>17</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_gpio.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_gpio.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>18</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_i2c.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_i2c.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>19</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_misc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_misc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>20</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_pwc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_pwc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_rtc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_rtc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>22</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_sdio.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_sdio.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_spi.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_spi.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_tmr.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_tmr.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_usart.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_usart.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_usb.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_usb.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_wdt.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_wdt.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_wwdt.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_wwdt.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_xmc.c</PathWithFileName>
<FilenameWithoutPath>at32f403a_407_xmc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>cmsis</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\cmsis\cm4\device_support\system_at32f403a_407.c</PathWithFileName>
<FilenameWithoutPath>system_at32f403a_407.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>31</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\libraries\cmsis\cm4\device_support\startup\mdk\startup_at32f403a_407.s</PathWithFileName>
<FilenameWithoutPath>startup_at32f403a_407.s</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>usbd_drivers</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_core.c</PathWithFileName>
<FilenameWithoutPath>usbd_core.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_int.c</PathWithFileName>
<FilenameWithoutPath>usbd_int.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_sdr.c</PathWithFileName>
<FilenameWithoutPath>usbd_sdr.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>usbd_class</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\middlewares\usbd_class\winusb\winusb_class.c</PathWithFileName>
<FilenameWithoutPath>winusb_class.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\middlewares\usbd_class\winusb\winusb_desc.c</PathWithFileName>
<FilenameWithoutPath>winusb_desc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>readme</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>37</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\readme.txt</PathWithFileName>
<FilenameWithoutPath>readme.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>

View File

@@ -0,0 +1,627 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>winusb</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>-AT32F403AVGT7</Device>
<Vendor>ArteryTek</Vendor>
<PackID>ArteryTek.AT32F403A_407_DFP.2.0.2</PackID>
<Cpu>IRAM(0x20000000,0x38000) IROM(0x08000000,0x100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0AT32F403A_1024 -FS08000000 -FL0100000 -FP0($$Device:-AT32F403AVGT7$Flash\AT32F403A_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:-AT32F403AVGT7$Device\Include\at32f40x.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:-AT32F403AVGT7$SVD\AT32F403Axx_v2.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
<ButtonStop>0</ButtonStop>
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\objects\</OutputDirectory>
<OutputName>winusb</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\listings\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>0</AlwaysBuild>
<GenerateAssemblyFile>0</GenerateAssemblyFile>
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments> -REMAP -MPU</SimDllArguments>
<SimDlgDll>DCM.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments> -MPU</TargetDllArguments>
<TargetDlgDll>TCM.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
<HexSelection>1</HexSelection>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
</DebugOption>
<Utilities>
<Flash1>
<UseTargetDll>1</UseTargetDll>
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>4096</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
<ArmAdsMisc>
<GenerateListings>0</GenerateListings>
<asHll>1</asHll>
<asAsm>1</asAsm>
<asMacX>1</asMacX>
<asSyms>1</asSyms>
<asFals>1</asFals>
<asDbgD>1</asDbgD>
<asForm>1</asForm>
<ldLst>0</ldLst>
<ldmm>1</ldmm>
<ldXref>1</ldXref>
<BigEnd>0</BigEnd>
<AdsALst>1</AdsALst>
<AdsACrf>1</AdsACrf>
<AdsANop>0</AdsANop>
<AdsANot>0</AdsANot>
<AdsLLst>1</AdsLLst>
<AdsLmap>1</AdsLmap>
<AdsLcgr>1</AdsLcgr>
<AdsLsym>1</AdsLsym>
<AdsLszi>1</AdsLszi>
<AdsLtoi>1</AdsLtoi>
<AdsLsun>1</AdsLsun>
<AdsLven>1</AdsLven>
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
<hadIROM>1</hadIROM>
<hadIRAM>1</hadIRAM>
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
<RwSelD>3</RwSelD>
<CodeSel>0</CodeSel>
<OptFeed>0</OptFeed>
<NoZi1>0</NoZi1>
<NoZi2>0</NoZi2>
<NoZi3>0</NoZi3>
<NoZi4>0</NoZi4>
<NoZi5>0</NoZi5>
<Ro1Chk>0</Ro1Chk>
<Ro2Chk>0</Ro2Chk>
<Ro3Chk>0</Ro3Chk>
<Ir1Chk>1</Ir1Chk>
<Ir2Chk>0</Ir2Chk>
<Ra1Chk>0</Ra1Chk>
<Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk>
<Im1Chk>1</Im1Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories>
<Ocm1>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm1>
<Ocm2>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm2>
<Ocm3>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm5>
<Ocm6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x38000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x100000</Size>
</IROM>
<XRAM>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x100000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT5>
<OCR_RVCT6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT6>
<OCR_RVCT7>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT7>
<OCR_RVCT8>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x38000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>1</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
<Strict>0</Strict>
<EnumInt>0</EnumInt>
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>2</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>0</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>AT32F403AVGT7,USE_STDPERIPH_DRIVER,AT_START_F403A_V1</Define>
<Undefine></Undefine>
<IncludePath>..\inc;..\..\..\..\..\at32f403a_407_board;..\..\..\..\..\..\libraries\drivers\inc;..\..\..\..\..\..\libraries\cmsis\cm4\core_support;..\..\..\..\..\..\libraries\cmsis\cm4\device_support;..\..\..\..\..\..\middlewares\usbd_drivers\inc;..\..\..\..\..\..\middlewares\usbd_class\winusb</IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
<umfTarg>1</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile></ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>user</GroupName>
<Files>
<File>
<FileName>at32f403a_407_clock.c</FileName>
<FileType>1</FileType>
<FilePath>..\src\at32f403a_407_clock.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_int.c</FileName>
<FileType>1</FileType>
<FilePath>..\src\at32f403a_407_int.c</FilePath>
</File>
<File>
<FileName>main.c</FileName>
<FileType>1</FileType>
<FilePath>..\src\main.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>bsp</GroupName>
<Files>
<File>
<FileName>at32f403a_407_board.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\at32f403a_407_board\at32f403a_407_board.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>firmware</GroupName>
<Files>
<File>
<FileName>at32f403a_407_acc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_acc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_adc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_adc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_bpr.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_bpr.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_can.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_can.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_crc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_crc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_crm.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_crm.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_dac.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_dac.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_debug.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_debug.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_dma.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_dma.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_emac.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_emac.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_exint.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_exint.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_flash.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_flash.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_gpio.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_gpio.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_i2c.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_i2c.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_misc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_misc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_pwc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_pwc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_rtc.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_sdio.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_sdio.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_spi.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_spi.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_tmr.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_tmr.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_usart.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_usart.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_usb.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_usb.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_wdt.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_wdt.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_wwdt.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_wwdt.c</FilePath>
</File>
<File>
<FileName>at32f403a_407_xmc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\drivers\src\at32f403a_407_xmc.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>cmsis</GroupName>
<Files>
<File>
<FileName>system_at32f403a_407.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\libraries\cmsis\cm4\device_support\system_at32f403a_407.c</FilePath>
</File>
<File>
<FileName>startup_at32f403a_407.s</FileName>
<FileType>2</FileType>
<FilePath>..\..\..\..\..\..\libraries\cmsis\cm4\device_support\startup\mdk\startup_at32f403a_407.s</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>usbd_drivers</GroupName>
<Files>
<File>
<FileName>usbd_core.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_core.c</FilePath>
</File>
<File>
<FileName>usbd_int.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_int.c</FilePath>
</File>
<File>
<FileName>usbd_sdr.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\middlewares\usbd_drivers\src\usbd_sdr.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>usbd_class</GroupName>
<Files>
<File>
<FileName>winusb_class.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\middlewares\usbd_class\winusb\winusb_class.c</FilePath>
</File>
<File>
<FileName>winusb_desc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\middlewares\usbd_class\winusb\winusb_desc.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>readme</GroupName>
<Files>
<File>
<FileName>readme.txt</FileName>
<FileType>5</FileType>
<FilePath>..\readme.txt</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
<RTE>
<apis/>
<components/>
<files/>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

View File

@@ -0,0 +1,10 @@
/**
**************************************************************************
* @file readme.txt
* @brief readme
**************************************************************************
*/
this demo is based on the at-start board, in this demo, show how to build
a device of winusb.
for more detailed information, please refer to the application note document AN0097.

View File

@@ -0,0 +1,98 @@
/**
**************************************************************************
* @file at32f403a_407_clock.c
* @brief system clock config program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* includes ------------------------------------------------------------------*/
#include "at32f403a_407_clock.h"
/**
* @brief system clock config program
* @note the system clock is configured as follow:
* system clock (sclk) = hext / 2 * pll_mult
* system clock source = pll (hext)
* - hext = HEXT_VALUE
* - sclk = 192000000
* - ahbdiv = 1
* - ahbclk = 192000000
* - apb2div = 2
* - apb2clk = 96000000
* - apb1div = 2
* - apb1clk = 96000000
* - pll_mult = 48
* - pll_range = GT72MHZ (greater than 72 mhz)
* @param none
* @retval none
*/
void system_clock_config(void)
{
/* reset crm */
crm_reset();
crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
/* wait till hext is ready */
while(crm_hext_stable_wait() == ERROR)
{
}
/* config pll clock resource */
crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_48, CRM_PLL_OUTPUT_RANGE_GT72MHZ);
/* config hext division */
crm_hext_clock_div_set(CRM_HEXT_DIV_2);
/* enable pll */
crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
/* wait till pll is ready */
while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
{
}
/* config ahbclk */
crm_ahb_div_set(CRM_AHB_DIV_1);
/* config apb2clk, the maximum frequency of APB1/APB2 clock is 120 MHz */
crm_apb2_div_set(CRM_APB2_DIV_2);
/* config apb1clk, the maximum frequency of APB1/APB2 clock is 120 MHz */
crm_apb1_div_set(CRM_APB1_DIV_2);
/* enable auto step mode */
crm_auto_step_mode_enable(TRUE);
/* select pll as system clock source */
crm_sysclk_switch(CRM_SCLK_PLL);
/* wait till pll is used as system clock source */
while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
{
}
/* disable auto step mode */
crm_auto_step_mode_enable(FALSE);
/* update system_core_clock global variable */
system_core_clock_update();
}

View File

@@ -0,0 +1,141 @@
/**
**************************************************************************
* @file at32f403a_407_int.c
* @brief main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* includes ------------------------------------------------------------------*/
#include "at32f403a_407_int.h"
/** @addtogroup AT32F403A_periph_examples
* @{
*/
/** @addtogroup 403A_USB_device_winusb
* @{
*/
/**
* @brief this function handles nmi exception.
* @param none
* @retval none
*/
void NMI_Handler(void)
{
}
/**
* @brief this function handles hard fault exception.
* @param none
* @retval none
*/
void HardFault_Handler(void)
{
/* go to infinite loop when hard fault exception occurs */
while(1)
{
}
}
/**
* @brief this function handles memory manage exception.
* @param none
* @retval none
*/
void MemManage_Handler(void)
{
/* go to infinite loop when memory manage exception occurs */
while(1)
{
}
}
/**
* @brief this function handles bus fault exception.
* @param none
* @retval none
*/
void BusFault_Handler(void)
{
/* go to infinite loop when bus fault exception occurs */
while(1)
{
}
}
/**
* @brief this function handles usage fault exception.
* @param none
* @retval none
*/
void UsageFault_Handler(void)
{
/* go to infinite loop when usage fault exception occurs */
while(1)
{
}
}
/**
* @brief this function handles svcall exception.
* @param none
* @retval none
*/
void SVC_Handler(void)
{
}
/**
* @brief this function handles debug monitor exception.
* @param none
* @retval none
*/
void DebugMon_Handler(void)
{
}
/**
* @brief this function handles pendsv_handler exception.
* @param none
* @retval none
*/
void PendSV_Handler(void)
{
}
/**
* @brief this function handles systick handler.
* @param none
* @retval none
*/
void SysTick_Handler(void)
{
}
/**
* @}
*/
/**
* @}
*/

View File

@@ -0,0 +1,207 @@
/**
**************************************************************************
* @file main.c
* @brief main program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
#include "at32f403a_407_board.h"
#include "at32f403a_407_clock.h"
#include "usbd_core.h"
#include "winusb_class.h"
#include "winusb_desc.h"
#include "usbd_int.h"
/** @addtogroup AT32F403A_periph_examples
* @{
*/
/** @addtogroup 403A_USB_device_winusb USB_device_winusb
* @{
*/
usbd_core_type usb_core_dev;
uint8_t usb_buffer[256];
/**
* @brief usb 48M clock select
* @param clk_s:USB_CLK_HICK, USB_CLK_HEXT
* @retval none
*/
void usb_clock48m_select(usb_clk48_s clk_s)
{
if(clk_s == USB_CLK_HICK)
{
crm_usb_clock_source_select(CRM_USB_CLOCK_SOURCE_HICK);
/* enable the acc calibration ready interrupt */
crm_periph_clock_enable(CRM_ACC_PERIPH_CLOCK, TRUE);
/* update the c1\c2\c3 value */
acc_write_c1(7980);
acc_write_c2(8000);
acc_write_c3(8020);
/* open acc calibration */
acc_calibration_mode_enable(ACC_CAL_HICKTRIM, TRUE);
}
else
{
switch(system_core_clock)
{
/* 48MHz */
case 48000000:
crm_usb_clock_div_set(CRM_USB_DIV_1);
break;
/* 72MHz */
case 72000000:
crm_usb_clock_div_set(CRM_USB_DIV_1_5);
break;
/* 96MHz */
case 96000000:
crm_usb_clock_div_set(CRM_USB_DIV_2);
break;
/* 120MHz */
case 120000000:
crm_usb_clock_div_set(CRM_USB_DIV_2_5);
break;
/* 144MHz */
case 144000000:
crm_usb_clock_div_set(CRM_USB_DIV_3);
break;
/* 168MHz */
case 168000000:
crm_usb_clock_div_set(CRM_USB_DIV_3_5);
break;
/* 192MHz */
case 192000000:
crm_usb_clock_div_set(CRM_USB_DIV_4);
break;
default:
break;
}
}
}
/**
* @brief main function.
* @param none
* @retval none
*/
int main(void)
{
uint16_t data_len;
uint32_t timeout;
/* config nvic priority group */
nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
system_clock_config();
at32_board_init();
/* select usb 48m clcok source */
usb_clock48m_select(USB_CLK_HEXT);
/* enable usb clock */
crm_periph_clock_enable(CRM_USB_PERIPH_CLOCK, TRUE);
/* enable usb interrupt */
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0, 0);
/* usb core init */
usbd_core_init(&usb_core_dev, USB, &winusb_class_handler, &winusb_desc_handler, 0);
/* enable usb pull-up */
usbd_connect(&usb_core_dev);
while(1)
{
/* get usb winusb receive data */
data_len = usb_winusb_get_rxdata(&usb_core_dev, usb_buffer);
if(data_len > 0)
{
/* bulk transfer is complete when the endpoint does one of the following
1 has transferred exactly the amount of data expected
2 transfers a packet with a payload size less than wMaxPacketSize or transfers a zero-length packet
*/
timeout = 5000000;
do
{
/* send data to host */
if(usb_winusb_send_data(&usb_core_dev, usb_buffer, data_len) == SUCCESS)
{
break;
}
}while(timeout --);
}
}
}
/**
* @brief this function handles usb interrupt.
* @param none
* @retval none
*/
void USBFS_L_CAN1_RX0_IRQHandler(void)
{
usbd_irq_handler(&usb_core_dev);
}
/**
* @brief usb delay millisecond function.
* @param ms: number of millisecond delay
* @retval none
*/
void usb_delay_ms(uint32_t ms)
{
/* user can define self delay function */
delay_ms(ms);
}
/**
* @brief usb delay microsecond function.
* @param us: number of microsecond delay
* @retval none
*/
void usb_delay_us(uint32_t us)
{
delay_us(us);
}
/**
* @}
*/
/**
* @}
*/

View File

@@ -132,14 +132,14 @@ void USBFS_L_CAN1_RX0_IRQHandler(void)
*/
void ACC_IRQHandler(void)
{
if(acc_flag_get(ACC_CALRDY_FLAG) != RESET)
if(acc_interrupt_flag_get(ACC_CALRDY_FLAG) != RESET)
{
at32_led_toggle(LED2);
/* clear acc calibration ready flag */
acc_flag_clear(ACC_CALRDY_FLAG);
}
if(acc_flag_get(ACC_RSLOST_FLAG) != RESET)
if(acc_interrupt_flag_get(ACC_RSLOST_FLAG) != RESET)
{
at32_led_toggle(LED3);

View File

@@ -10,7 +10,7 @@
<TargetName>combine_mode_ordinary_simult</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -141,7 +141,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma1_trans_complete_flag = 1;

View File

@@ -10,7 +10,7 @@
<TargetName>current_vref_value_check</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -10,7 +10,7 @@
<TargetName>exint_trigger_partitioned</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -142,7 +142,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag = 1;
@@ -156,7 +156,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
{
adc_flag_clear(ADC1, ADC_PCCE_FLAG);
if(preempt_trigger_count < 3)

View File

@@ -10,7 +10,7 @@
<TargetName>internal_temperature_sensor</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag++;

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag++;

View File

@@ -10,7 +10,7 @@
<TargetName>tmr_trigger_automatic_preempted</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma_trans_complete_flag = 1;
@@ -157,7 +157,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
{
adc_flag_clear(ADC1, ADC_PCCE_FLAG);
if(preempt_conversion_count < 5)

View File

@@ -10,7 +10,7 @@
<TargetName>triple_adc_synchro_trigger</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -143,7 +143,7 @@ void SysTick_Handler(void)
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
dma_flag_clear(DMA1_FDT1_FLAG);
dma1_trans_complete_flag = 1;
@@ -157,7 +157,7 @@ void DMA1_Channel1_IRQHandler(void)
*/
void DMA2_Channel4_5_IRQHandler(void)
{
if(dma_flag_get(DMA2_FDT5_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA2_FDT5_FLAG) != RESET)
{
dma_flag_clear(DMA2_FDT5_FLAG);
dma2_trans_complete_flag = 1;

View File

@@ -10,7 +10,7 @@
<TargetName>voltage_monitoring</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>

View File

@@ -142,7 +142,7 @@ void SysTick_Handler(void)
*/
void ADC1_2_IRQHandler(void)
{
if(adc_flag_get(ADC1, ADC_VMOR_FLAG) != RESET)
if(adc_interrupt_flag_get(ADC1, ADC_VMOR_FLAG) != RESET)
{
at32_led_toggle(LED3);
adc_flag_clear(ADC1, ADC_VMOR_FLAG);

View File

@@ -140,7 +140,7 @@ void SysTick_Handler(void)
*/
void TAMPER_IRQHandler(void)
{
if(bpr_flag_get(BPR_TAMPER_INTERRUPT_FLAG) != RESET)
if(bpr_interrupt_flag_get(BPR_TAMPER_INTERRUPT_FLAG) != RESET)
{
/* check if bpr registers are cleared */
if(bpr_reg_judge() == 0)

View File

@@ -108,7 +108,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -148,7 +148,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
if(rx_message_struct.standard_id == 0x400)
@@ -166,7 +166,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -133,7 +133,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -260,7 +260,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
if(test_result == 4)
{
@@ -288,7 +288,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -108,7 +108,7 @@ static void can_configuration(void)
nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
nvic_irq_enable(USBFS_L_CAN1_RX0_IRQn, 0x00, 0x00);
can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
/* error interrupt enable */
can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
@@ -148,7 +148,7 @@ static void can_transmit_data(void)
void USBFS_L_CAN1_RX0_IRQHandler (void)
{
can_rx_message_type rx_message_struct;
if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
{
can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
if(rx_message_struct.standard_id == 0x400)
@@ -164,7 +164,7 @@ void USBFS_L_CAN1_RX0_IRQHandler (void)
void CAN1_SE_IRQHandler(void)
{
__IO uint32_t err_index = 0;
if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
if(can_interrupt_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
{
err_index = CAN1->ests & 0x70;
can_flag_clear(CAN1, CAN_ETR_FLAG);

View File

@@ -55,6 +55,26 @@ void systick_handler(void)
}
}
/**
* @brief config systick and enable interrupt.
* @param none
* @retval none
*/
static uint32_t systick_interrupt_config(uint32_t ticks)
{
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
{
return (1UL);
}
SysTick->LOAD = (uint32_t)(ticks - 1UL);
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
SysTick->VAL = 0UL;
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk;
return (0UL);
}
/**
* @brief main function.
* @param none
@@ -68,7 +88,7 @@ int main(void)
systick_clock_source_config(SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV);
/* config systick reload value and enable interrupt */
SysTick_Config(MS_TICK);
systick_interrupt_config(MS_TICK);
/* configure led */
at32_led_init(LED2);

View File

@@ -44,7 +44,7 @@ uint16_t counter = 0;
*/
void TMR1_OVF_TMR10_IRQHandler(void)
{
if(tmr_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
{
/* add user code... */
at32_led_toggle(LED3);

View File

@@ -47,7 +47,7 @@ uint16_t src_buffer[BUFFER_SIZE] = {0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x00
*/
void DMA2_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA2_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA2_FDT1_FLAG) != RESET)
{
/* turn led2/led3/led4 on */
at32_led_on(LED2);

View File

@@ -59,7 +59,7 @@ error_status buffer_compare(const uint32_t* pbuffer, uint32_t* pbuffer1, uint16_
*/
void DMA1_Channel1_IRQHandler(void)
{
if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
if(dma_interrupt_flag_get(DMA1_FDT1_FLAG) != RESET)
{
data_counter_end = 0;
dma_flag_clear(DMA1_FDT1_FLAG);
@@ -157,4 +157,3 @@ int main(void)
/**
* @}
*/

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

View File

@@ -138,7 +138,7 @@ void SysTick_Handler(void)
*/
void TMR6_GLOBAL_IRQHandler(void)
{
if(tmr_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
if(tmr_interrupt_flag_get(TMR6, TMR_OVF_FLAG) != RESET)
{
/* Update the local_time by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */
time_update();

Some files were not shown because too many files have changed in this diff Show More